package com.gemme.gemme.wode;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.gemme.gemme.R;
import com.gemme.gemme.bravh.LoadMoreRefreshUseActivity;
import com.gemme.gemme.fragment.BaseLazyFragment;
import com.gemme.gemme.setting.SettingActivity;
import com.gemme.gemme.test.TestActivity;
import com.gemme.gemme.view.TvTvArrow;
import com.gemme.gemme.webview.FuZhiJIanCeNewActivity;


/**
 * Created by sp on 2019/7/18.
 * 首页
 */
public class WodeNewFragment extends BaseLazyFragment implements View.OnClickListener {
    View inflate;
    Context mContext;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        inflate = inflater.inflate(R.layout.fragment_wode_new, container, false);

        mContext = WodeNewFragment.this.getContext();

        initView(inflate);
        return inflate;
    }


    private void initView(View inflate) {
        //
        ImageView iv_head = inflate.findViewById(R.id.iv_head);
        //心愿单
        LinearLayout ll_xyd = inflate.findViewById(R.id.ll_xyd);
        LinearLayout ll_ptb = inflate.findViewById(R.id.ll_ptb);
        LinearLayout ll_zkj = inflate.findViewById(R.id.ll_zkj);

        //会员
        TextView tv_to_vip = inflate.findViewById(R.id.tv_to_vip);

        View ll_order = inflate.findViewById(R.id.ll_order);

        //发货
        LinearLayout ll_fukuan = inflate.findViewById(R.id.ll_fukuan);
        LinearLayout ll_fahuo = inflate.findViewById(R.id.ll_fahuo);
        LinearLayout ll_shouhuo = inflate.findViewById(R.id.ll_shouhuo);
        LinearLayout ll_pingjia = inflate.findViewById(R.id.ll_pingjia);
        LinearLayout ll_shouhou = inflate.findViewById(R.id.ll_shouhou);

        //足迹
        LinearLayout ll_zuji = inflate.findViewById(R.id.ll_zuji);
        LinearLayout ll_fans = inflate.findViewById(R.id.ll_fans);
        LinearLayout ll_address = inflate.findViewById(R.id.ll_address);



        LinearLayout ll_tjg = inflate.findViewById(R.id.ll_tjg);
        LinearLayout ll_fzjc = inflate.findViewById(R.id.ll_fzjc);
        LinearLayout ll_gywm = inflate.findViewById(R.id.ll_gywm);
        LinearLayout ll_yjfk = inflate.findViewById(R.id.ll_yjfk);
        LinearLayout ll_setting = inflate.findViewById(R.id.ll_setting);

        iv_head.setOnClickListener(this);
        ll_xyd.setOnClickListener(this);
        ll_ptb.setOnClickListener(this);
        ll_zkj.setOnClickListener(this);

        tv_to_vip.setOnClickListener(this);

        ll_order.setOnClickListener(this);

        ll_fukuan.setOnClickListener(this);
        ll_fahuo.setOnClickListener(this);
        ll_shouhuo.setOnClickListener(this);
        ll_pingjia.setOnClickListener(this);
        ll_shouhou.setOnClickListener(this);

        ll_zuji.setOnClickListener(this);
        ll_fans.setOnClickListener(this);
        ll_address.setOnClickListener(this);

        ll_tjg.setOnClickListener(this);
        ll_fzjc.setOnClickListener(this);
        ll_gywm.setOnClickListener(this);
        ll_yjfk.setOnClickListener(this);
        ll_setting.setOnClickListener(this);

        ll_address.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {

                startActivity(new Intent(mContext,TestActivity.class));
                return false;
            }
        });
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.iv_head:
//                startActivity(new Intent(mContext, SettingActivity.class));
                break;
            case R.id.ll_xyd:
                startActivity(new Intent(mContext, XinYuanDanActivity.class));
                break;
            case R.id.ll_ptb:
//                PlatformMoneyActivity
//                startActivity(new Intent(mContext, PlatformMoneyActivity.class));
                startActivity(new Intent(mContext, PlatformMoneyNewActivity.class));
                break;
            case R.id.ll_zkj:
                startActivity(new Intent(mContext, WoJuanActivity.class));
                break;
            case R.id.tv_to_vip:
                startActivity(new Intent(mContext, VipActivity.class));
                break;

            case R.id.ll_fukuan:

                break;
            case R.id.ll_order:
//                startActivity(new Intent(mContext, WoDingdanActivity.class));
                startActivity(new Intent(mContext, WoDingdanNewActivity.class));
                break;
            case R.id.ll_fahuo:
//                PlatformMoneyActivity
                break;
            case R.id.ll_shouhuo:

                break;

            case R.id.ll_pingjia:
                startActivity(new Intent(mContext, EvaluateActivity.class));
                break;
            case R.id.ll_shouhou:
//                PlatformMoneyActivity
                break;

            case R.id.ll_zuji:
                startActivity(new Intent(mContext, RecodeActivity.class));
                break;
            case R.id.ll_fans:
//                PlatformMoneyActivity
                startActivity(new Intent(mContext, WoFansActivity.class));
                break;
            case R.id.ll_address:
                startActivity(new Intent(mContext, AddressNewActivity.class));
                break;


            case R.id.ll_tjg:

//                startActivity(new Intent(mContext, TuiJianguanActivity.class));
                startActivity(new Intent(mContext, TuiJianGuanNewActivity.class));
                break;
            case R.id.ll_fzjc:
//                PlatformMoneyActivity
//                startActivity(new Intent(mContext, FuZhiJIanCeActivity.class));
                startActivity(new Intent(mContext, FuZhiJIanCeNewActivity.class));
                break;

            case R.id.ll_gywm:
                break;
            case R.id.ll_yjfk:
//                PlatformMoneyActivity
                break;
            case R.id.ll_setting:
                startActivity(new Intent(mContext, SettingActivity.class));
                break;
        }

    }

    @Override
    public void onLazyLoad() {

        //yc

//        getData();
    }



}
